Optimal. Leaf size=40 \[ \frac {1}{8} i \tanh ^{-1}(\sin (x))+\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.13, antiderivative size = 40, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 8, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.615, Rules used = {3599, 3187,
3186, 2686, 30, 2691, 3853, 3855} \begin {gather*} \frac {\sec ^3(x)}{3}+\frac {1}{8} i \tanh ^{-1}(\sin (x))-\frac {1}{4} i \tan (x) \sec ^3(x)+\frac {1}{8} i \tan (x) \sec (x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 30
Rule 2686
Rule 2691
Rule 3186
Rule 3187
Rule 3599
Rule 3853
Rule 3855
Rubi steps
\begin {align*} \int \frac {\sec ^5(x)}{i+\cot (x)} \, dx &=-\int \frac {\sec ^4(x) \tan (x)}{-\cos (x)-i \sin (x)} \, dx\\ &=i \int \sec ^4(x) (-i \cos (x)-\sin (x)) \tan (x) \, dx\\ &=i \int \left (-i \sec ^3(x) \tan (x)-\sec ^3(x) \tan ^2(x)\right ) \, dx\\ &=-\left (i \int \sec ^3(x) \tan ^2(x) \, dx\right )+\int \sec ^3(x) \tan (x) \, dx\\ &=-\frac {1}{4} i \sec ^3(x) \tan (x)+\frac {1}{4} i \int \sec ^3(x) \, dx+\text {Subst}\left (\int x^2 \, dx,x,\sec (x)\right )\\ &=\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x)+\frac {1}{8} i \int \sec (x) \, dx\\ &=\frac {1}{8} i \tanh ^{-1}(\sin (x))+\frac {\sec ^3(x)}{3}+\frac {1}{8} i \sec (x) \tan (x)-\frac {1}{4} i \sec ^3(x) \tan (x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.65, size = 61, normalized size = 1.52 \begin {gather*} -\frac {1}{48} i \left (6 \left (\log \left (\cos \left (\frac {x}{2}\right )-\sin \left (\frac {x}{2}\right )\right )-\log \left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right )\right )+\sec ^3(x) (16 i-3 (-3+\cos (2 x)) \tan (x))\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 115 vs. \(2 (29 ) = 58\).
time = 0.26, size = 116, normalized size = 2.90
method | result | size |
risch | \(\frac {3 \,{\mathrm e}^{7 i x}+11 \,{\mathrm e}^{5 i x}+53 \,{\mathrm e}^{3 i x}-3 \,{\mathrm e}^{i x}}{12 \left ({\mathrm e}^{2 i x}+1\right )^{4}}-\frac {i \ln \left ({\mathrm e}^{i x}-i\right )}{8}+\frac {i \ln \left ({\mathrm e}^{i x}+i\right )}{8}\) | \(66\) |
default | \(\frac {i}{4 \left (\tan \left (\frac {x}{2}\right )+1\right )^{4}}+\frac {i \ln \left (\tan \left (\frac {x}{2}\right )+1\right )}{8}+\frac {\frac {1}{3}-\frac {i}{2}}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{3}}+\frac {\frac {1}{2}-\frac {i}{8}}{\tan \left (\frac {x}{2}\right )+1}+\frac {-\frac {1}{2}+\frac {3 i}{8}}{\left (\tan \left (\frac {x}{2}\right )+1\right )^{2}}-\frac {i \ln \left (\tan \left (\frac {x}{2}\right )-1\right )}{8}-\frac {i}{4 \left (\tan \left (\frac {x}{2}\right )-1\right )^{4}}+\frac {-\frac {1}{3}-\frac {i}{2}}{\left (\tan \left (\frac {x}{2}\right )-1\right )^{3}}+\frac {-\frac {1}{2}-\frac {3 i}{8}}{\left (\tan \left (\frac {x}{2}\right )-1\right )^{2}}+\frac {-\frac {1}{2}-\frac {i}{8}}{\tan \left (\frac {x}{2}\right )-1}\) | \(116\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 167 vs. \(2 (26) = 52\).
time = 0.30, size = 167, normalized size = 4.18 \begin {gather*} -\frac {-\frac {3 i \, \sin \left (x\right )}{\cos \left (x\right ) + 1} - \frac {8 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {21 i \, \sin \left (x\right )^{3}}{{\left (\cos \left (x\right ) + 1\right )}^{3}} + \frac {24 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} - \frac {21 i \, \sin \left (x\right )^{5}}{{\left (\cos \left (x\right ) + 1\right )}^{5}} - \frac {24 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {3 i \, \sin \left (x\right )^{7}}{{\left (\cos \left (x\right ) + 1\right )}^{7}} + 8}{12 \, {\left (\frac {4 \, \sin \left (x\right )^{2}}{{\left (\cos \left (x\right ) + 1\right )}^{2}} - \frac {6 \, \sin \left (x\right )^{4}}{{\left (\cos \left (x\right ) + 1\right )}^{4}} + \frac {4 \, \sin \left (x\right )^{6}}{{\left (\cos \left (x\right ) + 1\right )}^{6}} - \frac {\sin \left (x\right )^{8}}{{\left (\cos \left (x\right ) + 1\right )}^{8}} - 1\right )}} + \frac {1}{8} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} + 1\right ) - \frac {1}{8} i \, \log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 123 vs. \(2 (26) = 52\).
time = 3.50, size = 123, normalized size = 3.08 \begin {gather*} -\frac {3 \, {\left (-i \, e^{\left (8 i \, x\right )} - 4 i \, e^{\left (6 i \, x\right )} - 6 i \, e^{\left (4 i \, x\right )} - 4 i \, e^{\left (2 i \, x\right )} - i\right )} \log \left (e^{\left (i \, x\right )} + i\right ) + 3 \, {\left (i \, e^{\left (8 i \, x\right )} + 4 i \, e^{\left (6 i \, x\right )} + 6 i \, e^{\left (4 i \, x\right )} + 4 i \, e^{\left (2 i \, x\right )} + i\right )} \log \left (e^{\left (i \, x\right )} - i\right ) - 6 \, e^{\left (7 i \, x\right )} - 22 \, e^{\left (5 i \, x\right )} - 106 \, e^{\left (3 i \, x\right )} + 6 \, e^{\left (i \, x\right )}}{24 \, {\left (e^{\left (8 i \, x\right )} + 4 \, e^{\left (6 i \, x\right )} + 6 \, e^{\left (4 i \, x\right )} + 4 \, e^{\left (2 i \, x\right )} + 1\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{5}{\left (x \right )}}{\cot {\left (x \right )} + i}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 87 vs. \(2 (26) = 52\).
time = 0.40, size = 87, normalized size = 2.18 \begin {gather*} -\frac {3 i \, \tan \left (\frac {1}{2} \, x\right )^{7} + 24 \, \tan \left (\frac {1}{2} \, x\right )^{6} + 21 i \, \tan \left (\frac {1}{2} \, x\right )^{5} - 24 \, \tan \left (\frac {1}{2} \, x\right )^{4} + 21 i \, \tan \left (\frac {1}{2} \, x\right )^{3} + 8 \, \tan \left (\frac {1}{2} \, x\right )^{2} + 3 i \, \tan \left (\frac {1}{2} \, x\right ) - 8}{12 \, {\left (\tan \left (\frac {1}{2} \, x\right )^{2} - 1\right )}^{4}} + \frac {1}{8} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) + 1\right ) - \frac {1}{8} i \, \log \left (\tan \left (\frac {1}{2} \, x\right ) - 1\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.46, size = 81, normalized size = 2.02 \begin {gather*} \frac {\mathrm {atanh}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\,1{}\mathrm {i}}{4}-\frac {\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^7\,1{}\mathrm {i}}{4}+2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^6+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^5\,7{}\mathrm {i}}{4}-2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^4+\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3\,7{}\mathrm {i}}{4}+\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}+\frac {\mathrm {tan}\left (\frac {x}{2}\right )\,1{}\mathrm {i}}{4}-\frac {2}{3}}{{\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2-1\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________